package com.zhs.gccs.dialog;

import android.content.Context;
import android.view.Gravity;
import android.view.View;

import com.hjq.shape.view.ShapeButton;
import com.zhs.gccs.R;
import com.zhs.gccs.utils.OnNoDoubleClickListener;
import com.zhs.gccs.utils.ScreenUtils;

/**
 * Created by chengzf on 2024/7/22.
 */
public class LayerExampleDialog {

    public static class Builder extends BaseDialog.Builder<Builder> {

        private ShapeButton btn_close;

        public Builder(Context context) {
            super(context);
            setContentView(R.layout.dialog_layer_example);
            setAnimStyle(BaseDialog.ANIM_IOS);
            setGravity(Gravity.CENTER);
            setBackgroundDimEnabled(true);
            setCancelable(true);
            setCanceledOnTouchOutside(true);
            setWidth((int) (ScreenUtils.dpToPx(context, ScreenUtils.getScreenWidthDp(context)) * 0.85));
            btn_close = findViewById(R.id.btn_close);
            btn_close.setOnClickListener(new OnNoDoubleClickListener() {
                @Override
                protected void onNoDoubleClick(View v) {
                    dismiss();
                }
            });
        }

    }
}
